[PATCH 28/30] swap: do not send discards as barriers

From: Christoph Hellwig <hch [at] infradead.org>

The swap code already uses synchronous discards, no need to add I/O barriers.

tj: superflous newlines removed.

Signed-off-by: Christoph Hellwig <hch [at] lst.de>
Acked-by: Hugh Dickins <hughd [at] google.com>
Tested-by: Nigel Cunningham <nigel [at] tuxonice.net>
Signed-off-by: Tejun Heo <tj [at] kernel.org>
---
mm/swapfile.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/mm/swapfile.c b/mm/swapfile.c
index 1f3f9c5..68cda16 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
[at] [at] -141,8 +141,7 [at] [at] static int discard_swap(struct swap_info_struct *si)
nr_blocks = ((sector_t)se->nr_pages - 1) << (PAGE_SHIFT - 9);
if (nr_blocks) {
err = blkdev_issue_discard(si->bdev, start_block,
- nr_blocks, GFP_KERNEL,
- BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER);
+ nr_blocks, GFP_KERNEL, BLKDEV_IFL_WAIT);
if (err)
return err;
cond_resched();
[at] [at] -153,8 +152,7 [at] [at] static int discard_swap(struct swap_info_struct *si)
nr_blocks = (sector_t)se->nr_pages << (PAGE_SHIFT - 9);

err = blkdev_issue_discard(si->bdev, start_block,
- nr_blocks, GFP_KERNEL,
- BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER);
+ nr_blocks, GFP_KERNEL, BLKDEV_IFL_WAIT);
if (err)
break;

[at] [at] -193,8 +191,7 [at] [at] static void discard_swap_cluster(struct swap_info_struct *si,
start_block <<= PAGE_SHIFT - 9;
nr_blocks <<= PAGE_SHIFT - 9;
if (blkdev_issue_discard(si->bdev, start_block,
- nr_blocks, GFP_NOIO, BLKDEV_IFL_WAIT |
- BLKDEV_IFL_BARRIER))
+ nr_blocks, GFP_NOIO, BLKDEV_IFL_WAIT))
break;
}

--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo [at] vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Tejun Heo [ Mi, 25 August 2010 17:47 ] [ ID #2046609 ]
Linux » gmane.linux.raid » [PATCH 28/30] swap: do not send discards as barriers

Vorheriges Thema: [PATCH 4/4] block: remove the WRITE_BARRIER flag
Nächstes Thema: [PATCH 26/30] ext4: do not send discards as barriers